﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Grizzy_X
{
    public static class IDGenerator
    {
        public static int LayerMax=0;
        public static int PointMax=0;
        public static int LineMax=0;
        public static int PolygonMax=0;
        public static int TextMax=0;
        public static int LegendMax = 0;

        public static int LayerID()
        {
            LayerMax++;                  //此种写法从1开始记ID
            return LayerMax;
        }

        public static int PointID()
        {
            PointMax++;                  //此种写法从1开始记ID
            return PointMax;
        }

        public static int LineID()
        {
            LineMax++;                  //此种写法从1开始记ID
            return LineMax;
        }

        public static int PolygonID()
        {
            PolygonMax++;                  //此种写法从1开始记ID
            return PolygonMax;
        }

        public static int TextID()
        {
            TextMax++;                  //此种写法从1开始记ID
            return TextMax;
        }

        public static int MapLegendID()
        {
            LegendMax++;
            return LegendMax;
        }

        public static bool Reset()
        {
            try
            {
                LayerMax = 0;
                PointMax = 0;
                LineMax = 0;
                PolygonMax = 0;
                TextMax = 0;
                LegendMax = 0;
                return true;
            }
            catch
            {
                return false;
            }
        }
    }
}
